package cn.rongdao.jrkabao.ui.remind.uicomponent;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import cn.rongdao.jrkabao.R;
import cn.rongdao.jrkabao.bean.remind.RemindBean;

/**
 * Created by jack on 2017/9/11
 */

public class ItemRemindUIComponent extends RelativeLayout {
    public ItemRemindUIComponent(Context context) {
        super(context);
    }

    public ItemRemindUIComponent(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public ItemRemindUIComponent(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    private ImageView ivExample;
    private RemindDetailsUIComponent remindDetailsUIComponent;

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        ivExample = (ImageView) findViewById(R.id.ir_iv_example);
        remindDetailsUIComponent = (RemindDetailsUIComponent) findViewById(R.id.ir_remind_details);
    }

    public void setContent(RemindBean.RemindBankList data) {
        if (null != data) {
            setVisibility(View.VISIBLE);
            ivExample.setVisibility(data.isExample() ? VISIBLE : GONE);
            remindDetailsUIComponent.setGrayRemindBean(data);
        }
    }

    public void setRepaymentClickListener(OnClickListener onClickListener) {
        remindDetailsUIComponent.setRepaymentClickListener(onClickListener);
    }

    public void setCheckBalanceClickListener(OnClickListener onClickListener) {
        remindDetailsUIComponent.setCheckBalanceClickListener(onClickListener);
    }
}